{% extends "base.html" %}
{% block css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/item.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/sweetalert.css') }}">

<link rel="stylesheet" href="{{ url_for('static', filename='libs/easyui/easyui.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='libs/easyui/icon.css') }}">
{% endblock %}
{% block js %}
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/moment.js') }}"></script>

<script type="text/javascript" src="{{ url_for('static', filename='js/countdown.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/jquery.cookie.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/sweetalert.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/itemlist.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='libs/easyui/jquery.easyui.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='libs/easyui/jquery.numberspinner.js') }}"></script>

{% endblock %}
{% block content %}
<!-- <div class="row center-block"> -->
    {%for item in itemlist%}
    <div class="row center-block">
        <div class="item">
            <div class="itemid" style="display: none;">{{item.id}}</div>
            <a href="{{url_for('item.itemdetail')}}?id={{item.id}}" target="_blank"><img src="/static/img/items/{{item.id}}/title.jpg" style="width: 100%;height: 100%"></a>
            <div class="row center-block "><h5><a class="item_title" href="{{url_for('item.itemdetail')}}?id={{item.id}}" target="_blank">{{item.title}}</a></h5></div>
            <div><span><strong style="color: red;font-size: 24px;">¥{{item.now_price}}</strong></span><!-- <span style="margin-left: 5px;font-size: 16px;">¥<del>{{item.pre_price}}</del><b style="padding: 0 3px;">|</b>{{('%.1f')|format(item.now_price/item.pre_price*10)}}折</span> --><span style="margin-left: 10px">销量{{item.sold}}件</span><span id="inventory" style="margin-left: 10px">库存{{item.inventory}}件</span></div>
            <span class="inventory" style="display: none;">{{item.inventory}}</span>
             <div style="display: none;">结束时间<span class="start_time" style="display: none;">{{item.start_time}}</span><span class="end_time">{{item.end_time}}</span></div>
             <div class="item_info"><i class="fa fa-clock-o"></i><span class="countdown"></span></div>
            <div>
                <span style="margin-right: 10px">数量</span><input class="easyui-numberspinner" style="width:30%;" data-options="min:10,max:{{item.inventory}},editable:true,value:1">

                <span><button id="buy{{item.id}}" class="btn btn-danger btn-sm buy" style="margin-left: 30px">立即购买</button></span>
            </div>
        </div>
    </div>
    {%endfor%}

<!-- </div> -->
{% endblock %}
